Skip to content

Turn mismatch given errors into given not found errors #8607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

julienrf
Copy link
Contributor

Fixes #8053

When a given candidate turns out to not be applicable we used to report that
there is a mismatch between the candidate type and the expected type.

However, I believe that if there is a type mismatch, then the candidate should
not be a candidate in the first place.

I’ve changed the failure to be a NoMatchingImplicitsFailure instead of a mismatch.

Hopefully this won’t have a negative impact. I’ve added a couple of tests that used to
report a mismatch for the "candidate" $conforms[Nothing] and they now report that
no given could be found. One existing test was broken by my changes. This test was
very similar to the ones described in #8053, so I’ve changed the test expectation.

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

@julienrf julienrf force-pushed the replace-implicit-mismatch-with-implicit-not-found branch from 498ed16 to caa9c36 Compare March 25, 2020 13:57
Fixes #8053

When a given candidate turns out to not be applicable we used to report that
there is a mismatch between the candidate type and the expected type.

However, I believe that if there is a type mismatch, then the candidate should
not be a candidate in the first place.

I’ve changed the failure to be a `NoMatchingImplicitsFailure` instead of a mismatch.

Hopefully this won’t have a negative impact. I’ve added a couple of tests that used to
report a mismatch for the "candidate" `$conforms[Nothing]` and they now report that
no given could be found. One existing test was broken by my changes. This test was
very similar to the ones described in #8053, so I’ve changed the test expectation.
@julienrf julienrf force-pushed the replace-implicit-mismatch-with-implicit-not-found branch from caa9c36 to da29c0a Compare March 25, 2020 16:07
@smarter
Copy link
Member

smarter commented Mar 25, 2020

Please don't create branches in the lampepfl/dotty repository when making a PR, instead make a branch in your own fork.

@julienrf julienrf closed this Mar 25, 2020
@julienrf julienrf deleted the replace-implicit-mismatch-with-implicit-not-found branch March 25, 2020 16:26
@julienrf
Copy link
Contributor Author

Sorry!
I couldn’t find how to change the base repository of an existing PR so I’ve created another one: #8611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$conforms[Nothing] shows up as a placeholder for missing implicits
3 participants